package com.baidu.bos.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.baidu.bos.dao.IUserDao;
import com.baidu.bos.dao.base.BaseDaoImpl;
import com.baidu.bos.domain.User;

@Repository
public class UserDaoImpl extends BaseDaoImpl<User> implements IUserDao {

	public User findByUsername(String username) {
		String hql = "from User where username = ?";
		 List<User> list = this.getHibernateTemplate().find(hql, username);
		 if (list != null && list.size() > 0) {
			return list.get(0);
		}else {
			return null;
		}
	}
	
}
